/**
 * Created by Administrator on 2017/3/13 0013.
 */




Page6=function() {
        var whole = new PIXI.DisplayObjectContainer();
        var delayTime=5;

        var white=new PIXI.Graphics();
        white.beginFill(0xffffff,1);
        white.drawRect(0,0,1136,740);


        var bg1 = new PIXI.Sprite(resource["assets/images/p6_1.png"].texture);
        var bg1Mask=new PIXI.Sprite(resource["assets/images/p6_2.png"].texture);
        bg1.mask=bg1Mask;
        var bg1Real=new PIXI.Sprite(resource["assets/images/p6_1.png"].texture);
        var bg1RealMask=new PIXI.Graphics();
        bg1RealMask.beginFill(0xffffff,1);
        bg1RealMask.drawCircle(0,0,800);
        bg1RealMask.scale.set(2);
        bg1Real.mask=bg1RealMask;
        var word1=new PIXI.Sprite(resource["assets/images/p6_2.png"].texture);


        whole.addChild(white);
        whole.addChild(bg1);
        whole.addChild(bg1Mask);
        whole.addChild(bg1Real);
        whole.addChild(bg1RealMask);
        whole.addChild(word1);

        bg1.y=-50;

        bg1Mask.anchor.set(0.5);
        bg1Mask.x=62+bg1Mask.width/2;bg1Mask.y=180+bg1Mask.height/2;
        bg1Real.y=-50;
        bg1RealMask.x=1136/2;bg1RealMask.y=540/2;
        word1.x=62;word1.y=180;
        bg1Mask.alpha=0;
        bg1Mask.scale.set(10);
        bg1Real.alpha=0;
        word1.alpha=0;
        word1.tint=0xffff11;









        var bg2 = new PIXI.Sprite(resource["assets/images/p6_3.png"].texture);
        var bg2Mask=new PIXI.Sprite(resource["assets/images/p6_4.png"].texture);
        bg2.mask=bg2Mask;
        var bg2Real=new PIXI.Sprite(resource["assets/images/p6_3.png"].texture);
        var bg2RealMask=new PIXI.Graphics();
        bg2RealMask.beginFill(0xffffff,1);
        bg2RealMask.drawCircle(0,0,800);
        bg2RealMask.scale.set(2);
        bg2Real.mask=bg2RealMask;
        var word2=new PIXI.Sprite(resource["assets/images/p6_4.png"].texture);


        whole.addChild(bg2);
        whole.addChild(bg2Mask);
        whole.addChild(bg2Real);
        whole.addChild(bg2RealMask);
        whole.addChild(word2);

        bg2.y=-50;
        bg2Mask.anchor.set(0.5);
        bg2Mask.x=62+bg2Mask.width/2;bg2Mask.y=180+bg2Mask.height/2;
        bg2Real.y=-50;
        bg2RealMask.x=1136/2;bg2RealMask.y=540/2;
        word2.x=62;word2.y=180;

        bg2.alpha=0;
        bg2Mask.scale.set(10);
        bg2Real.alpha=0;
        word2.alpha=0;
        word2.tint=0xffff11;




        whole.In=function(){
                // bg1Mask.alpha=0;
                bg1Mask.scale.set(10);
                bg1Real.alpha=0;
                word1.alpha=0;
                word1.tint=0xffff11;
                TweenMax.to(bg1Mask,0.5,{delay:0.3,alpha:1,alpha:1});
                TweenMax.to(bg1Mask.scale,1,{delay:0.3,x:1,y:1,ease:Cubic.easeOut});
                TweenMax.to(bg1Real,0.7,{delay:1.3,alpha:1,ease:Cubic.easeOut});
                TweenMax.to(word1,0.7,{delay:1.3,alpha:1,tint:0xffffff,ease:Cubic.easeOut});


                bg1RealMask.scale.set(2);
                bg1.alpha=1;
                TweenMax.to(word1,1,{delay:delayTime-1,alpha:0,tint:0xff0000,ease:Cubic.easeOut});
                TweenMax.to(bg1RealMask.scale,0.7,{delay:delayTime-0.7,x:0,y:0,ease:Cubic.easeOut,onComplete:function () {
                        console.log('sssssssssssssssssssss')
                }});
                TweenMax.to(bg1,0.2,{delay:delayTime-1,alpha:0,ease:Cubic.easeOut});


                bg2.alpha=0;
                bg2Mask.scale.set(10);
                bg2Real.alpha=0;
                word2.alpha=0;
                word2.tint=0xffff11;
                TweenMax.to(bg2,0.7,{alpha:1,delay:delayTime,alpha:1});
                TweenMax.to(bg2Mask.scale,0.7,{delay:delayTime,x:1,y:1,ease:Cubic.easeOut});
                TweenMax.to(bg2Real,0.7,{delay:1+delayTime,alpha:1,ease:Cubic.easeOut});
                TweenMax.to(word2,0.7,{delay:1+delayTime,alpha:1,tint:0xffffff,ease:Cubic.easeOut});
                // TweenMax.to(word2,0.7,{delay:2+delayTime,alpha:0,tint:0xff0000,ease:Cubic.easeOut});

                // bg2.mask=bg2Mask;
                // TweenMax.to(bg2RealMask.scale,1,{delay:2.3,x:0,y:0,ease:Cubic.easeOut});
                // TweenMax.to(bg2,0.2,{delay:2,alpha:0,ease:Cubic.easeOut});
        }
        whole.Out=function() {
                TweenMax.killAll()
                // TweenMax.killTweensOf(bg1);
                // TweenMax.killTweensOf(bg1Mask);
                // TweenMax.killTweensOf(bg1Real);
                // TweenMax.killTweensOf(bg1RealMask);
                // TweenMax.killTweensOf(word1);
                // TweenMax.killTweensOf(bg2);
                // TweenMax.killTweensOf(bg2Mask);
                // TweenMax.killTweensOf(bg2Real);
                // TweenMax.killTweensOf(word2);


                // TweenMax.to(bg2Real, 1, {alpha: 0});
                // TweenMax.to(bg2, 1, {alpha: 0});
                // TweenMax.to(word2, 1, {alpha: 0});

                setTimeout(function () {


                        bg1Mask.alpha = 0;
                        bg1Mask.scale.set(10);
                        // bg1Real.alpha = 0;
                        word1.alpha = 0;
                        word1.tint = 0xffff11;


                        bg1RealMask.scale.set(2);
                        bg1.alpha = 1;

                        bg2.alpha = 0;
                        bg2Mask.scale.set(10);
                        bg2Real.alpha = 0;
                        word2.alpha = 0;
                        word2.tint = 0xffff11;

                }, 200);
        }


        whole.ReturnWhole=function(){
                return whole;
        };

        return whole;
}


